#pragma once
#include <iostream>
#include "Socket.h"
#include <functional>
#include <string>
class Click
{
public:
    using func_t=std::function<void(int)>;
public:
   Click(const uint16_t &port, func_t func)
   : _port(port),_func(func)
    {
        _listensock = _sock.Socket();//创建
        _sock.Connect(_listensock,_ip,_port);
    }
   
private:
    uint16_t _port;
    std::string _ip="0.0.0.0";
    Sock _sock;
    int _listensock;
    func_t _func;
};